import request from '@/utils/request'

const baseUrl = '/api/mongoconnection'

export function getConnectionList(params) {
  return request({
    url: baseUrl,
    method: 'get',
    params
  })
}

export function getConnectionById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function createConnection(data) {
  return request({
    url: baseUrl,
    method: 'post',
    data
  })
}

export function updateConnection(id, data) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'put',
    data
  })
}

export function deleteConnection(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}
